<template>
	<!-- 添加店铺 -->
	<view class="a_wp">
		<view class="a_list">
			<view class="a_title">
				店铺ID:
			</view>
			<view class="a_text">
				<input class="a_input" type="text" placeholder="请输入店铺ID" v-model="info.uid" />
			</view>
			<button size="mini" type="default" @click="searchStore">查询</button>
		</view>
		<view class="a_list">
			<view class="a_title">
				店铺名称:
			</view>
			<view class="a_text">
				{{info.supname}}
			</view>
		</view>
		<view class="a_list">
			<view class="a_title">
				店铺负责人:
			</view>
			<view class="a_text">
				{{info.nickname}}
			</view>
		</view>
		<view class="a_message">
			请先查询店铺ID，获取店铺信息后添加店铺。
		</view>
		<view class="a_sumbit" @click="onsumbit" v-preventClick>
			提交添加
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info: {
					uid: '',
					supname: '',
					nickname: ''
				}
			}
		},
		methods: {
			searchStore() {
				this.$axios('groupManager/getUidInfo', 'POST', 'supplier', {
					uid: this.info.uid
				}).then(res => {
					if (res.data.code == 200) {
						this.info=res.data.data;
					}
				})
			},
			onsumbit() {
				this.$axios('groupManager/saveGroupSup', 'POST', 'supplier', {
					uid: this.info.uid
				}).then(res => {
					if (res.data.code == 200) {
						this.$api.msg('提交成功！')
						this.$navRed('/pages/groupmenu/shopmanagement');
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.a_list {
		display: flex;
		align-items: center;
		padding: 20upx;
		position: relative;
	}

	.a_title {
		padding-right: 20upx;
		text-align: right;
	}

	.a_input {
		background-color: rgba(231, 231, 231, 0.7);
		border-radius: 10upx;
		font-size: 28upx;
		margin-right: 20upx;
		height: 60upx;
		padding: 0 20upx;
	}

	.a_text {
		color: #0062CC;
		flex: 1;
	}

	.a_message {
		color: $font-color-light;
		padding: 20upx;
		font-size: $font-sm;
	}

	.a_sumbit {
		background-color: $base-color;
		border-radius: 40upx;
		color: #fff;
		line-height: 75upx;
		margin: 50upx auto;
		text-align: center;
		width: 96%;
	}
</style>
